#include "friendinventationdialog.h"
#include "ui_friendinventationdialog.h"

FriendInventationDialog::FriendInventationDialog(const quint32 &napplicant_uid, const QString &applicant_nickName, const QString &rMessage, QWidget *parent) :
    QDialog(parent),
    m_ui(new Ui::FriendInventationDialog)
{
    m_ui->setupUi(this);

    m_ui->leFriendNickName->setText(applicant_nickName);
    m_ui->terMessage->setText(rMessage);

    applicant_uid = napplicant_uid;
}

FriendInventationDialog::~FriendInventationDialog()
{
    delete m_ui;
}

void FriendInventationDialog::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void FriendInventationDialog::on_buttonBox_clicked(QAbstractButton* button)
{
    if( button->text() == "OK" )
    {
        emit acceptFriendInventation(applicant_uid);
    }
}
